home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
07
/
6
/
DISK0760.ZIP
/
CURTIME.INC
< prev
next >
Wrap
Text File
|
1987-11-15
|
754b
|
39 lines
Type
MG_TimeStr = String[10];
Function CurrentTime : MG_TimeStr;
{** Returns the current time in '99:99:99 am/pm' format **}
Const
Am = 'am';
Pm = 'pm';
Var
Hour,Minute,Second,Sec100 : Word;
HStr,MStr,Sstr : String[2];
AmPm : String[2];
Begin
GetTime(Hour,Minute,Second,Sec100);
AmPm := Am;
If Hour = 0 then
Begin
Hour := 12;
AmPm := Pm;
End;
If Hour > 12 then
Begin
Hour := Hour - 12;
AmPm := Pm;
End;
Str(Hour:2,HStr);
If HStr[1] = ' ' then
HStr[1] := '0';
Str(Minute:2,MStr);
If MStr[1] = ' ' then
MStr[1] := '0';
Str(Second:2,SStr);
If SStr[1] = ' ' then
SStr[1] := '0';
CurrentTime := Concat(HStr,':',mStr,':',SStr,AmPm);
End; {CurrentTime}